package com.cs.club.common.utlis;

import com.cs.club.common.entity.ErrorCode;
import com.cs.club.common.exception.BusinessException;

public class ThrowUtils {

    public static void throwIf(boolean condition, ErrorCode errorCode) {
        if (condition) {
            throw new BusinessException(errorCode);
        }
    }

    public static void throwIf(boolean condition, ErrorCode errorCode, String message) {
        if (condition) {
            throw new BusinessException(errorCode,message);
        }
    }
}
